let Mock = require('mockjs');
let obj = {
    "code": 666,
    "msg": "success",
    "data": [
        {
            "eui": "7BI78729534",
            "mhz": "CN568-024",
            "online": false,
            "country": "China",
            "agreement": "LoRaWAN",
            "year": 2020,
            "month": 9,
            "time": "08:30:58",
            "name": "土壤温湿度传感器",
            "powerNum": 60,
            "nums": "3",
            "devGroup": "济南农业基地",
            "loop": 3,
            "date": 16,
            "bTime": "2020/9/16 08:30:58",
            "uploadTime": "2020/9,/16 08:30:58",
            "devName": "土壤温湿度",
            "devValue": "82%RH"
        },
        {
            "eui": "3NU63320836",
            "mhz": "CN738-322",
            "online": true,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2019,
            "month": 8,
            "time": "06:38:29",
            "name": "土壤温湿度传感器",
            "powerNum": 64,
            "nums": "1",
            "devGroup": "济南农业基地",
            "loop": 7,
            "date": 22,
            "bTime": "2019/8/22 06:38:29",
            "uploadTime": "2019/8,/22 06:38:29",
            "devName": "土壤温湿度",
            "devValue": "86%RH"
        },
        {
            "eui": "7GA24028175",
            "mhz": "CN792-146",
            "online": false,
            "country": "China",
            "agreement": "LoRaPP",
            "year": 2016,
            "month": 5,
            "time": "00:20:40",
            "name": "气压传感器",
            "powerNum": 18,
            "nums": "4",
            "devGroup": "潍坊农业基地",
            "loop": 1,
            "date": 27,
            "bTime": "2016/5/27 00:20:40",
            "uploadTime": "2017/43/27 00:20:40",
            "devName": "气压",
            "devValue": "31402Pa"
        },
        {
            "eui": "1YU41176393",
            "mhz": "CN168-387",
            "online": false,
            "country": "China",
            "agreement": "LoRaWAN",
            "year": 2015,
            "month": 9,
            "time": "10:59:49",
            "name": "土壤温湿度传感器",
            "powerNum": 86,
            "nums": "1",
            "devGroup": "青岛市农业基地",
            "loop": 5,
            "date": 12,
            "bTime": "2015/9/12 10:59:49",
            "uploadTime": "2016/79/12 10:59:49",
            "devName": "土壤温湿度",
            "devValue": "68%RH"
        },
        {
            "eui": "3VW36123639",
            "mhz": "CN997-473",
            "online": false,
            "country": "China",
            "agreement": "LoRaPP",
            "year": 2010,
            "month": 1,
            "time": "21:24:27",
            "name": "土壤温湿度传感器",
            "powerNum": 55,
            "nums": "1",
            "devGroup": "青岛市农业基地",
            "loop": 1,
            "date": 29,
            "bTime": "2010/1/29 21:24:27",
            "uploadTime": "2010/1,/29 21:24:27",
            "devName": "土壤温湿度",
            "devValue": "97%RH"
        },
        {
            "eui": "8GI47494726",
            "mhz": "CN928-848",
            "online": false,
            "country": "China",
            "agreement": "4G/2G",
            "year": 2013,
            "month": 2,
            "time": "14:11:24",
            "name": "气压传感器",
            "powerNum": 90,
            "nums": "1",
            "devGroup": "潍坊农业基地",
            "loop": 5,
            "date": 7,
            "bTime": "2013/2/7 14:11:24",
            "uploadTime": "2014/9/7 14:11:24",
            "devName": "气压",
            "devValue": "65112Pa"
        },
        {
            "eui": "4LD74523599",
            "mhz": "CN842-765",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2020,
            "month": 5,
            "time": "00:13:17",
            "name": "土壤温湿度传感器",
            "powerNum": 15,
            "nums": "3",
            "devGroup": "济南农业基地",
            "loop": 3,
            "date": 21,
            "bTime": "2020/5/21 00:13:17",
            "uploadTime": "2020/5,/21 00:13:17",
            "devName": "土壤温湿度",
            "devValue": "79%RH"
        },
        {
            "eui": "7CL44835594",
            "mhz": "CN916-837",
            "online": true,
            "country": "China",
            "agreement": "LoRaPP",
            "year": 2016,
            "month": 10,
            "time": "12:43:01",
            "name": "光照传感器",
            "powerNum": 69,
            "nums": "5",
            "devGroup": "菏泽农业基地",
            "loop": 5,
            "date": 27,
            "bTime": "2016/10/27 12:43:01",
            "uploadTime": "2017/93/27 12:43:01",
            "devName": "光照",
            "devValue": "40Lux"
        },
        {
            "eui": "3JV32012960",
            "mhz": "CN328-801",
            "online": true,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2013,
            "month": 4,
            "time": "13:46:29",
            "name": "土壤温湿度传感器",
            "powerNum": 84,
            "nums": "4",
            "devGroup": "泰安农业基地",
            "loop": 3,
            "date": 22,
            "bTime": "2013/4/22 13:46:29",
            "uploadTime": "2014/29/22 13:46:29",
            "devName": "土壤温湿度",
            "devValue": "79%RH"
        },
        {
            "eui": "6NA59615671",
            "mhz": "CN376-116",
            "online": true,
            "country": "China",
            "agreement": "LoRaWAN",
            "year": 2020,
            "month": 10,
            "time": "00:10:29",
            "name": "气压传感器",
            "powerNum": 76,
            "nums": "5",
            "devGroup": "泰安农业基地",
            "loop": 5,
            "date": 23,
            "bTime": "2020/10/23 00:10:29",
            "uploadTime": "2021/93/23 00:10:29",
            "devName": "气压",
            "devValue": "16808Pa"
        },
        {
            "eui": "4RX74444211",
            "mhz": "CN461-752",
            "online": true,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2013,
            "month": 4,
            "time": "20:01:41",
            "name": "气压传感器",
            "powerNum": 14,
            "nums": "1",
            "devGroup": "泰安农业基地",
            "loop": 3,
            "date": 20,
            "bTime": "2013/4/20 20:01:41",
            "uploadTime": "2013/4,/20 20:01:41",
            "devName": "气压",
            "devValue": "83492Pa"
        },
        {
            "eui": "8GF80518435",
            "mhz": "CN431-586",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2014,
            "month": 2,
            "time": "01:09:36",
            "name": "空气温湿度传感器",
            "powerNum": 95,
            "nums": "6",
            "devGroup": "威海农业基地",
            "loop": 7,
            "date": 19,
            "bTime": "2014/2/19 01:09:36",
            "uploadTime": "2014/2,/19 01:09:36",
            "devName": "空气温湿度",
            "devValue": "52%RH"
        },
        {
            "eui": "4VK92205331",
            "mhz": "CN215-261",
            "online": true,
            "country": "China",
            "agreement": "4G/2G",
            "year": 2011,
            "month": 10,
            "time": "18:34:51",
            "name": "光照传感器",
            "powerNum": 69,
            "nums": "4",
            "devGroup": "菏泽农业基地",
            "loop": 3,
            "date": 9,
            "bTime": "2011/10/9 18:34:51",
            "uploadTime": "2012/89/9 18:34:51",
            "devName": "光照",
            "devValue": "87Lux"
        },
        {
            "eui": "8DC51400422",
            "mhz": "CN629-113",
            "online": false,
            "country": "China",
            "agreement": "4G/2G",
            "year": 2018,
            "month": 3,
            "time": "09:55:22",
            "name": "气压传感器",
            "powerNum": 38,
            "nums": "4",
            "devGroup": "济南农业基地",
            "loop": 7,
            "date": 25,
            "bTime": "2018/3/25 09:55:22",
            "uploadTime": "2018/3,/25 09:55:22",
            "devName": "气压",
            "devValue": "63610Pa"
        },
        {
            "eui": "3UO62916118",
            "mhz": "CN438-367",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2013,
            "month": 4,
            "time": "03:16:44",
            "name": "二氧化碳传感器",
            "powerNum": 28,
            "nums": "2",
            "devGroup": "泰安农业基地",
            "loop": 3,
            "date": 24,
            "bTime": "2013/4/24 03:16:44",
            "uploadTime": "2013/4,/24 03:16:44",
            "devName": "二氧化碳",
            "devValue": "264ppm"
        },
        {
            "eui": "8DF81816522",
            "mhz": "CN887-681",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2014,
            "month": 2,
            "time": "17:20:47",
            "name": "气压传感器",
            "powerNum": 72,
            "nums": "3",
            "devGroup": "济南农业基地",
            "loop": 7,
            "date": 26,
            "bTime": "2014/2/26 17:20:47",
            "uploadTime": "2015/13/26 17:20:47",
            "devName": "气压",
            "devValue": "89604Pa"
        },
        {
            "eui": "6PH55129627",
            "mhz": "CN242-330",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2011,
            "month": 3,
            "time": "12:56:09",
            "name": "空气温湿度传感器",
            "powerNum": 61,
            "nums": "5",
            "devGroup": "菏泽农业基地",
            "loop": 5,
            "date": 21,
            "bTime": "2011/3/21 12:56:09",
            "uploadTime": "2012/19/21 12:56:09",
            "devName": "空气温湿度",
            "devValue": "30%RH"
        },
        {
            "eui": "1NH91731437",
            "mhz": "CN177-634",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2013,
            "month": 12,
            "time": "07:28:30",
            "name": "二氧化碳传感器",
            "powerNum": 2,
            "nums": "6",
            "devGroup": "菏泽农业基地",
            "loop": 5,
            "date": 24,
            "bTime": "2013/12/24 07:28:30",
            "uploadTime": "2013/undefined/24 07:28:30",
            "devName": "二氧化碳",
            "devValue": "133ppm"
        },
        {
            "eui": "6UI65564481",
            "mhz": "CN882-162",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2015,
            "month": 11,
            "time": "10:36:59",
            "name": "空气温湿度传感器",
            "powerNum": 33,
            "nums": "4",
            "devGroup": "济南农业基地",
            "loop": 1,
            "date": 23,
            "bTime": "2015/11/23 10:36:59",
            "uploadTime": "2015/11,/23 10:36:59",
            "devName": "空气温湿度",
            "devValue": "26%RH"
        },
        {
            "eui": "6YQ89853514",
            "mhz": "CN028-634",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2012,
            "month": 3,
            "time": "12:59:37",
            "name": "二氧化碳传感器",
            "powerNum": 74,
            "nums": "5",
            "devGroup": "菏泽农业基地",
            "loop": 3,
            "date": 22,
            "bTime": "2012/3/22 12:59:37",
            "uploadTime": "2012/3,/22 12:59:37",
            "devName": "二氧化碳",
            "devValue": "193ppm"
        },
        {
            "eui": "0XC13428415",
            "mhz": "CN880-843",
            "online": true,
            "country": "China",
            "agreement": "LoRaPP",
            "year": 2018,
            "month": 12,
            "time": "22:28:24",
            "name": "空气温湿度传感器",
            "powerNum": 50,
            "nums": "4",
            "devGroup": "泰安农业基地",
            "loop": 5,
            "date": 2,
            "bTime": "2018/12/2 22:28:24",
            "uploadTime": "2018/undefined/2 22:28:24",
            "devName": "空气温湿度",
            "devValue": "56%RH"
        },
        {
            "eui": "6HV41967305",
            "mhz": "CN067-561",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2012,
            "month": 2,
            "time": "23:20:28",
            "name": "土壤温湿度传感器",
            "powerNum": 98,
            "nums": "1",
            "devGroup": "济南农业基地",
            "loop": 1,
            "date": 12,
            "bTime": "2012/2/12 23:20:28",
            "uploadTime": "2013/13/12 23:20:28",
            "devName": "土壤温湿度",
            "devValue": "89%RH"
        },
        {
            "eui": "5HH25348938",
            "mhz": "CN073-173",
            "online": true,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2019,
            "month": 12,
            "time": "07:09:25",
            "name": "空气温湿度传感器",
            "powerNum": 4,
            "nums": "3",
            "devGroup": "威海农业基地",
            "loop": 1,
            "date": 27,
            "bTime": "2019/12/27 07:09:25",
            "uploadTime": "2019/undefined/27 07:09:25",
            "devName": "空气温湿度",
            "devValue": "95%RH"
        },
        {
            "eui": "6FE46144346",
            "mhz": "CN577-764",
            "online": false,
            "country": "China",
            "agreement": "LoRaWAN",
            "year": 2014,
            "month": 5,
            "time": "12:59:09",
            "name": "空气温湿度传感器",
            "powerNum": 92,
            "nums": "3",
            "devGroup": "菏泽农业基地",
            "loop": 5,
            "date": 4,
            "bTime": "2014/5/4 12:59:09",
            "uploadTime": "2015/43/4 12:59:09",
            "devName": "空气温湿度",
            "devValue": "52%RH"
        },
        {
            "eui": "0NL42711071",
            "mhz": "CN525-452",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2017,
            "month": 10,
            "time": "15:39:05",
            "name": "光照传感器",
            "powerNum": 24,
            "nums": "5",
            "devGroup": "泰安农业基地",
            "loop": 3,
            "date": 2,
            "bTime": "2017/10/2 15:39:05",
            "uploadTime": "2017/10,/2 15:39:05",
            "devName": "光照",
            "devValue": "59Lux"
        },
        {
            "eui": "8TT76461244",
            "mhz": "CN223-014",
            "online": true,
            "country": "China",
            "agreement": "LoRaWAN",
            "year": 2018,
            "month": 10,
            "time": "13:58:04",
            "name": "土壤温湿度传感器",
            "powerNum": 91,
            "nums": "5",
            "devGroup": "潍坊农业基地",
            "loop": 5,
            "date": 25,
            "bTime": "2018/10/25 13:58:04",
            "uploadTime": "2018/10,/25 13:58:04",
            "devName": "土壤温湿度",
            "devValue": "30%RH"
        },
        {
            "eui": "8OC18479836",
            "mhz": "CN513-015",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2016,
            "month": 9,
            "time": "10:53:23",
            "name": "土壤温湿度传感器",
            "powerNum": 10,
            "nums": "4",
            "devGroup": "济南农业基地",
            "loop": 1,
            "date": 14,
            "bTime": "2016/9/14 10:53:23",
            "uploadTime": "2016/9,/14 10:53:23",
            "devName": "土壤温湿度",
            "devValue": "38%RH"
        },
        {
            "eui": "5JA67018323",
            "mhz": "CN130-644",
            "online": false,
            "country": "China",
            "agreement": "LoRaWAN",
            "year": 2018,
            "month": 8,
            "time": "06:49:56",
            "name": "光照传感器",
            "powerNum": 5,
            "nums": "6",
            "devGroup": "潍坊农业基地",
            "loop": 1,
            "date": 19,
            "bTime": "2018/8/19 06:49:56",
            "uploadTime": "2018/8,/19 06:49:56",
            "devName": "光照",
            "devValue": "88Lux"
        },
        {
            "eui": "8GN89151384",
            "mhz": "CN482-462",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2016,
            "month": 10,
            "time": "09:19:07",
            "name": "土壤温湿度传感器",
            "powerNum": 13,
            "nums": "2",
            "devGroup": "潍坊农业基地",
            "loop": 3,
            "date": 7,
            "bTime": "2016/10/7 09:19:07",
            "uploadTime": "2016/10,/7 09:19:07",
            "devName": "土壤温湿度",
            "devValue": "47%RH"
        },
        {
            "eui": "8BJ27119452",
            "mhz": "CN720-088",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2014,
            "month": 4,
            "time": "05:11:38",
            "name": "二氧化碳传感器",
            "powerNum": 34,
            "nums": "4",
            "devGroup": "潍坊农业基地",
            "loop": 3,
            "date": 16,
            "bTime": "2014/4/16 05:11:38",
            "uploadTime": "2015/33/16 05:11:38",
            "devName": "二氧化碳",
            "devValue": "132ppm"
        },
        {
            "eui": "1LD03752778",
            "mhz": "CN740-837",
            "online": true,
            "country": "China",
            "agreement": "LoRaPP",
            "year": 2019,
            "month": 11,
            "time": "21:34:43",
            "name": "土壤温湿度传感器",
            "powerNum": 13,
            "nums": "5",
            "devGroup": "菏泽农业基地",
            "loop": 7,
            "date": 6,
            "bTime": "2019/11/6 21:34:43",
            "uploadTime": "2020/103/6 21:34:43",
            "devName": "土壤温湿度",
            "devValue": "38%RH"
        },
        {
            "eui": "8LJ96131118",
            "mhz": "CN345-991",
            "online": false,
            "country": "China",
            "agreement": "LoRaWAN",
            "year": 2015,
            "month": 2,
            "time": "04:43:53",
            "name": "气压传感器",
            "powerNum": 68,
            "nums": "4",
            "devGroup": "潍坊农业基地",
            "loop": 1,
            "date": 11,
            "bTime": "2015/2/11 04:43:53",
            "uploadTime": "2015/2,/11 04:43:53",
            "devName": "气压",
            "devValue": "78003Pa"
        },
        {
            "eui": "6RJ63936015",
            "mhz": "CN452-502",
            "online": false,
            "country": "China",
            "agreement": "LoRaPP",
            "year": 2016,
            "month": 4,
            "time": "08:23:33",
            "name": "空气温湿度传感器",
            "powerNum": 33,
            "nums": "6",
            "devGroup": "威海农业基地",
            "loop": 7,
            "date": 20,
            "bTime": "2016/4/20 08:23:33",
            "uploadTime": "2017/33/20 08:23:33",
            "devName": "空气温湿度",
            "devValue": "74%RH"
        },
        {
            "eui": "6XT35401880",
            "mhz": "CN914-892",
            "online": true,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2019,
            "month": 7,
            "time": "14:38:52",
            "name": "空气温湿度传感器",
            "powerNum": 70,
            "nums": "1",
            "devGroup": "威海农业基地",
            "loop": 3,
            "date": 29,
            "bTime": "2019/7/29 14:38:52",
            "uploadTime": "2020/59/29 14:38:52",
            "devName": "空气温湿度",
            "devValue": "86%RH"
        },
        {
            "eui": "5MS69972196",
            "mhz": "CN922-583",
            "online": false,
            "country": "China",
            "agreement": "4G/2G",
            "year": 2015,
            "month": 11,
            "time": "20:47:40",
            "name": "二氧化碳传感器",
            "powerNum": 29,
            "nums": "2",
            "devGroup": "泰安农业基地",
            "loop": 5,
            "date": 15,
            "bTime": "2015/11/15 20:47:40",
            "uploadTime": "2016/99/15 20:47:40",
            "devName": "二氧化碳",
            "devValue": "171ppm"
        },
        {
            "eui": "1HZ15250247",
            "mhz": "CN973-315",
            "online": true,
            "country": "China",
            "agreement": "4G/2G",
            "year": 2015,
            "month": 12,
            "time": "12:21:41",
            "name": "土壤温湿度传感器",
            "powerNum": 34,
            "nums": "5",
            "devGroup": "泰安农业基地",
            "loop": 3,
            "date": 15,
            "bTime": "2015/12/15 12:21:41",
            "uploadTime": "2015/undefined/15 12:21:41",
            "devName": "土壤温湿度",
            "devValue": "62%RH"
        },
        {
            "eui": "2ED85442694",
            "mhz": "CN050-318",
            "online": false,
            "country": "China",
            "agreement": "LoRaWAN",
            "year": 2019,
            "month": 1,
            "time": "02:46:53",
            "name": "二氧化碳传感器",
            "powerNum": 15,
            "nums": "5",
            "devGroup": "菏泽农业基地",
            "loop": 3,
            "date": 28,
            "bTime": "2019/1/28 02:46:53",
            "uploadTime": "2019/1,/28 02:46:53",
            "devName": "二氧化碳",
            "devValue": "202ppm"
        },
        {
            "eui": "6VC13264380",
            "mhz": "CN286-641",
            "online": true,
            "country": "China",
            "agreement": "LoRaWAN",
            "year": 2016,
            "month": 9,
            "time": "22:04:51",
            "name": "二氧化碳传感器",
            "powerNum": 94,
            "nums": "1",
            "devGroup": "威海农业基地",
            "loop": 7,
            "date": 24,
            "bTime": "2016/9/24 22:04:51",
            "uploadTime": "2016/9,/24 22:04:51",
            "devName": "二氧化碳",
            "devValue": "216ppm"
        },
        {
            "eui": "9RZ05361075",
            "mhz": "CN842-852",
            "online": false,
            "country": "China",
            "agreement": "LoRaWAN",
            "year": 2017,
            "month": 10,
            "time": "04:11:08",
            "name": "二氧化碳传感器",
            "powerNum": 98,
            "nums": "2",
            "devGroup": "菏泽农业基地",
            "loop": 3,
            "date": 19,
            "bTime": "2017/10/19 04:11:08",
            "uploadTime": "2018/93/19 04:11:08",
            "devName": "二氧化碳",
            "devValue": "293ppm"
        },
        {
            "eui": "5UT41284232",
            "mhz": "CN857-661",
            "online": false,
            "country": "China",
            "agreement": "NB-IoT",
            "year": 2016,
            "month": 10,
            "time": "13:56:15",
            "name": "气压传感器",
            "powerNum": 99,
            "nums": "5",
            "devGroup": "济南农业基地",
            "loop": 7,
            "date": 18,
            "bTime": "2016/10/18 13:56:15",
            "uploadTime": "2017/93/18 13:56:15",
            "devName": "气压",
            "devValue": "78032Pa"
        }
    ]
}


let list = obj.data;
let group = list.map(item=>item.devGroup);
let set = new Set(group);
let groupList = [...set];
let newList = groupList.map(groupName=> {
    let itemList = list.filter(item=>groupName === item.devGroup);
    let id = Mock.mock('@id');
    // 传感器数量
    let nodeNums = itemList.length;
    // 开发套件
    let groupNums = 10;
    // devNums 设备数量
    let  devNums = 9;
    // 在线设备数量
    let  onlineNums = itemList.filter(item=>item.online==='在线').length;
    let cTime = Mock.mock(/202[01]-0[1-9]-[1-2][1-28]/)  + Mock.Random.time("HH:mm:ss");
    return {
        id,
        nodeNums,
        groupNums,
        devNums,
        onlineNums,
        cTime
    }
})

console.log(newList);

// "groupName": "7788",
// "nodeNums": "22",
// "groupNums": "13",
// "devNums": "9",
// "online": true,
// "onlineNums": "7",
// "cTime": "2021-09-01 15:36:08"